package Pieces;

import Gamefield.FieldPosition;
import Gamefield.Player;

public class PieceMovement {
	private char _fig;
	private FieldPosition _posTo;
	private FieldPosition _posFrom;
	private boolean _capture;
	private boolean _promotion;
	private boolean _errorOccured =false;
	private Player _player;
	private MoveDirections _move;

	public MoveDirections getMove() {
		return _move;
	}

	public void setMove(MoveDirections move) {
		this._move = move;
	}

	public char getFig() {
		return _fig;
	}
	
	public void setFig(char fig) {
		this._fig = fig;
	}
	
	public FieldPosition getPosTo() {
		return _posTo;
	}
	
	public void setPosTo(FieldPosition posTo) {
		this._posTo = posTo;
	}

	public FieldPosition getPosFrom() {
		return _posFrom;
	}
	
	public void setPosFrom(FieldPosition posFrom) {
		this._posFrom = posFrom;
	}
	
	public boolean isCapture() {
		return _capture;
	}
	
	public void setCapture(boolean capture) {
		this._capture = capture;
	}
	
	public boolean isPromotion() {
		return _promotion;
	}
	
	public void setPromotion(boolean promotion) {
		this._promotion = promotion;
	}
	
	public boolean isErrorOccured() {
		return _errorOccured;
	}
	
	public void setErrorOccured(boolean _errorOccured) {
		this._errorOccured = _errorOccured;
	}
	
	public String toString(){
		StringBuilder sB = new StringBuilder();
		
		sB.append(_fig);
		sB.append(_posFrom.toString());
		sB.append(_posTo.toString());
		if(_capture){
			sB.append('x');
		}
		if(_promotion){
			sB.append('!');
		}	
		
		return sB.toString();
	}

	public Player getPlayer() {
		return _player;
	}

	public void setPlayer(Player _player) {
		this._player = _player;
	}
}
